package logic

import (
	"context"
	"medi-reserve/model"

	"medi-reserve/medirpc/internal/svc"
	"medi-reserve/medirpc/medirpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type DelReserveLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDelReserveLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelReserveLogic {
	return &DelReserveLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *DelReserveLogic) DelReserve(in *medirpc.DelReserveRequest) (*medirpc.DelReserveResponse, error) {
	// todo: add your logic here and delete this line
	var Reserve model.Reserve
	err := Reserve.ReserveDel(model.DB, in.ReserveId)
	if err != nil {
		return nil, err
	}
	return &medirpc.DelReserveResponse{}, nil
}
